--[[
------------------------------------------------------------------------------
	This file contains all the functions for entities and there scripted
	events.  We do this to avoid creating a file for each one.
	
	Author: Tony Sparks
	Date: 4-11-07
------------------------------------------------------------------------------
--]]

--[[ Constant conversions --]]
-----------------------------------------------------------------------
-- Door constants
CLOSE_DOOR		= "IDLE";
OPEN_DOOR		= "WALKING";
LOCK_DOOR		= "ATTACKING1";

-- Torch constants
LITE			= "WALKING";
UNLITE			= "IDLE";



--[[-- Door Operations --]]
------------------------------------------------------------------------

-- Close a Door
function EF_CloseDoor( doorName )
	entity.Pick( doorName );
	entity.SetState( CLOSE_DOOR );
end

-- Open a Door
function EF_OpenDoor( doorName )
	entity.Pick( doorName );
	entity.SetState( OPEN_DOOR );
end

-- Lock a Door
function EF_LockDoor( doorName )
	entity.Pick( doorName );
	entity.SetState( LOCK_DOOR );
end




--[[-- Torch Operations --]]
------------------------------------------------------------------------

-- Lite a torch
function EF_LiteTorch( torchName )
	entity.Pick( torchName );
	entity.SetState( LITE );
end

-- Diffuse a lite
function EF_UnLiteTorch( torchName )
	entity.Pick( torchName );
	entity.SetState( UNLITE );
end